Skip to content

bpo-47103: Copy pgort140.dll into output directory when building PGInstrument on Windows#32083

Merged
zooba merged 4 commits into
python:mainfrom
zooba:bpo-47103
Apr 6, 2022
Merged

bpo-47103: Copy pgort140.dll into output directory when building PGInstrument on Windows#32083
zooba merged 4 commits into
python:mainfrom
zooba:bpo-47103

Conversation

@zooba

@zooba zooba commented Mar 23, 2022

Copy link
Copy Markdown
Member

@neonene

neonene commented Mar 25, 2022

Copy link
Copy Markdown
Contributor

The following 2 tests in test_embed.py failed with the same error:

test_init_pybuilddir_win32
test_init_pyvenv_cfg

Traceback (most recent call last):
  File "C:\cp\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\cp\Lib\test\test_embed.py", line 1225, in tmpdir_with_python
    yield tmpdir
    ^^^^^^^^^^^^
  File "C:\cp\Lib\test\test_embed.py", line 1347, in test_init_pybuilddir_win32
    self.check_all_configs("test_init_compat_config", config,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\cp\Lib\test\test_embed.py", line 738, in check_all_configs
    out, err = self.run_embedded_interpreter(testname,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\cp\Lib\test\test_embed.py", line 117, in run_embedded_interpreter
    self.assertEqual(p.returncode, returncode,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 3221225781 != 0 : bad returncode 3221225781, stderr is ''

Comment thread PCbuild/python.vcxproj
@@ -132,9 +132,6 @@ set PYTHONPATH=$(PySourcePath)Lib
</Target>
<Target Name="GeneratePythonBat" AfterTargets="AfterBuild">
<PropertyGroup>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PropertyGroup>
<PropertyGroup>
<_PGOPath Condition="$(Configuration) == 'PGInstrument'">@set PATH=%PATH%%3B$(OutDir)</_PGOPath>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving $(_PGOPath) like this fixes my errors. The way is more generic than #32146.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, your other PR is better. We shouldn't rely on PATH for resolving DLLs, but should copy the right one alongside the executable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I see you've closed it, so I'll add a similar change to this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional change is perfect for PGO/non-PGO.
I can confirm PGInstrument builds work with this.

@zooba zooba merged commit 074da78 into python:main Apr 6, 2022
@zooba zooba deleted the bpo-47103 branch April 6, 2022 10:56
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @zooba, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 074da788028c1f1e867dc81698efdcdc263f2288 3.9

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry @zooba, I had trouble checking out the 3.10 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 074da788028c1f1e867dc81698efdcdc263f2288 3.10

zooba added a commit to zooba/cpython that referenced this pull request Apr 6, 2022
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Apr 6, 2022
@bedevere-bot

Copy link
Copy Markdown

GH-32366 is a backport of this pull request to the 3.10 branch.

@bedevere-bot

Copy link
Copy Markdown

GH-32407 is a backport of this pull request to the 3.9 branch.

zooba added a commit that referenced this pull request Apr 8, 2022
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants